package com.gears_software.sxdc.dccx.data.finder;

import com.gears_software.sxdc.dccx.data.finder.util.GearsAuthInterceptor;
import com.gears_software.sxdc.dccx.data.model.AddressList;
import com.gears_software.sxdc.dccx.data.model.ResultModel;
import com.gears_software.sxdc.dccx.data.model.request.RAddAddressModel;

import org.androidannotations.rest.spring.annotations.Body;
import org.androidannotations.rest.spring.annotations.Get;
import org.androidannotations.rest.spring.annotations.Path;
import org.androidannotations.rest.spring.annotations.Post;
import org.androidannotations.rest.spring.annotations.Put;
import org.androidannotations.rest.spring.annotations.Rest;
import org.androidannotations.rest.spring.api.RestClientErrorHandling;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

import java.util.List;

/**
 * Created by SunMuran on 2017/8/16.
 * 常用地址相关接口
 */
@Rest(rootUrl = RequestUrl.ROOT, converters = {MappingJackson2HttpMessageConverter.class}, interceptors = GearsAuthInterceptor.class)
public interface IUsualAddressFinder extends RestClientErrorHandling {
    /**
     * 常用地址列表
     */
    @Get("/api/address/list")
    ResultModel<List<AddressList>> getAddressList();
    /**
     *添加常用地址
     */
    @Post("/api/address/add")
    ResultModel<String> addAddress(@Body RAddAddressModel addAddress);
    /**
     *修改常用地址
     */
    @Put("/api/address/update?id={id}")
    ResultModel<String> updateAddress(@Body RAddAddressModel addAddressModel, @Path String id);
    /**
     * 删除常用列表
     */
    @Get("/api/address/delete?id={id}")
    ResultModel<String> deleteAddress(@Path String id);

}
